import csv
import numpy as np

arr=np.array([])

with open('class1.csv','r',newline='') as file:
    reader=csv.reader(file)
    next(reader)
    for i in reader:
        arr = np.append(arr,int(i[2]))
with open('class2.csv', 'r', newline='') as file:
    reader = csv.reader(file)
    next(reader)
    for i in reader:
        arr = np.append(arr, int(i[2]))
with open('class3.csv','r',newline='') as file:
    reader=csv.reader(file)
    next(reader)
    for i in reader:
        arr = np.append(arr,int(i[2]))

print(arr)
mean=np.mean(arr)
n=np.median(arr)
value,count=np.unique(arr,return_counts=True)
mc=value[count.argmax()]
variance=np.var(arr)
sd=np.std(arr)
print(mean)
print(n)
print(mc)
print(variance)
print(format(sd,'.2f'))
